HTML Full Course [Day 2] [Hindi]πŸ’‘ | Elements, Attributes, Formatting | Mohit Decodes

HTML Tutorial – Part 2: Elements, Attributes & Text Formatting

Welcome back to the HTML Full Course by Mohit Decodes! In this tutorial, we’ll dive deeper into essential building blocks of HTML – elements, attributes, headings, paragraphs, and how to style and format your text.

1️⃣ HTML Elements

HTML elements are the foundation of every webpage. They define the structure and content.

βœ… Common Elements:

  1. <h1> to <h6> – Headings
  2. <p> – Paragraph
  3. <div> – Division or section
  4. <span> – Inline container
  5. <a> – Anchor (links)
  6. <img> – Image

πŸ“Œ Example:

html
CopyEdit
<p>This is a paragraph element.</p>

2️⃣ HTML Attributes

Attributes provide additional information about elements. They are always written inside the opening tag.

βœ… Examples of Attributes:

  1. href for links
  2. src for images
  3. alt for image description
  4. style for inline CSS

πŸ“Œ Example:

html
CopyEdit
<a href="https://mohitdecodes.com">Visit My Website</a>

3️⃣ HTML Headings

Headings are used to define titles or subtitles on a page. There are 6 levels: from <h1> (most important) to <h6> (least important).

πŸ“Œ Example:

html
CopyEdit
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Section Title</h3>

4️⃣ HTML Paragraphs

The <p> tag defines a paragraph of text. It automatically adds space before and after the content.

πŸ“Œ Example:

html
CopyEdit
<p>This is a paragraph of text explaining a topic.</p>

5️⃣ HTML Styles

The style attribute is used to add CSS directly to an element for quick customization.

πŸ“Œ Example:

html
CopyEdit
<p style="color: blue; font-size: 18px;">Styled paragraph</p>

πŸ“ Note: Inline styles are useful for small tweaks, but it's better to use internal or external CSS for larger projects.

6️⃣ Text Formatting Tags

HTML offers tags to format text visually and semantically.

βœ… Common Formatting Tags:

  1. <b> – Bold (non-semantic)
  2. <strong> – Bold (semantic)
  3. <i> – Italic (non-semantic)
  4. <em> – Emphasis (semantic)
  5. <mark> – Highlighted text
  6. <u> – Underlined
  7. <small> – Smaller text
  8. <del> – Deleted (strikethrough)
  9. <ins> – Inserted (underlined)

πŸ“Œ Example:

html
CopyEdit
<p>This is <strong>important</strong> and <em>emphasized</em> text.</p>